package com.rtx.edi.platform.baseinfo.service;

import java.util.List;
import java.util.Map;

import com.rtx.edi.model.api.bo.ApiMappingInfoBo;
import com.rtx.edi.model.api.po.PlApiMapping;
import com.rtx.edi.model.api.po.PlApiMappingStructure;
import com.rtx.edi.model.log.po.PlApiRequestLog;
import com.rtx.edi.model.request.SyncRequest;

/**
 * api服务
 */
public interface PlApiService {

    /**
     * 根据公司ID,场景ID获取API场景映射信息
     * @param companyId
     * @param apiMappingId
     */
    ApiMappingInfoBo getApiMappingInfo(Long companyId, Long apiMappingId,PlApiRequestLog log);
    
    /**
     * 根据场景ID获取API场景映射信息
     * @param companyId
     * @param apiMappingId
     */
    ApiMappingInfoBo getApiMappingInfo(String apiMappingCode);


    /**
     * 根据code获取对接场景
     * @param apiMappingCode
     * @return
     */
    PlApiMapping getPlApiMappingByApiMappingCode(String apiMappingCode);

    /**
     * 转换JSON
     * @param structureList
     * @param json
     * @return
     */
    String convertJson(List<PlApiMappingStructure> structureList,String json);

    /**
     * 转换JSON
     * @param structureList
     * @param json
     * @return
     */
    String convertJson(List<PlApiMappingStructure> structureList,String json,Map<String, Map<String, Object>> globalMap);

    /**
     * 转化同结构JSON
     * @param request
     * @return
     */
    String convertSameStructureJson(SyncRequest request,List<PlApiMappingStructure> structureList);

    /**
     * 根据场景ID获取报文结构
     * @param apiMappingId
     * @return
     */
    List<PlApiMappingStructure> getPlApiMappingStructure(Long apiMappingId);
}
